<li class="item-lesson clearfix" id="lesson-{{ lesson.id }}">
	<div class="item-line"></div>
	<div class="item-content">
	  {% set mediaStatus = lesson.mediaStatus|default(null) %}
		
		{% if lesson.type in ['video', 'live'] %}
		  {% if mediaStatus == 'waiting' %}
			<span class="glyphicon glyphicon-facetime-video text-warning"></span>
		  {% elseif mediaStatus == 'doing' %}
			<span class="glyphicon glyphicon-facetime-video text-info"></span>
		  {% elseif mediaStatus == 'error' %}
			<span class="glyphicon glyphicon-facetime-video text-danger"></span>
		  {% else %}
			<span class="glyphicon glyphicon-facetime-video text-success"></span>
		  {% endif %}
		{% elseif lesson.type == 'audio' %}
		  <span class="glyphicon glyphicon-volume-up text-success"></span>
		{% elseif lesson.type == 'testpaper' %}
		  <span class="glyphicon glyphicon-check text-success"></span>
		{% else %}
			<span class="glyphicon glyphicon-file text-success"></span>
		{% endif %}

		课时 <span class="number">{{ lesson.number }}</span>： {{ lesson.title }}

		{% if lesson.type in ['video', 'audio'] %}
		  <span class="text-muted">{{ lesson.length|duration }}</span>
		{% endif %}

		{% if lesson.type in ['live'] %}
		  <span class="text-muted">{{ lesson.startTime|data_format }}</span>
		{% endif %}

		{% if lesson.giveCredit > 0 %}
		  <small class="text-muted">({{ lesson.giveCredit }}学分)</small>
		{% endif %}

    {% if lesson.requireCredit > 0 %}
      <small class="text-muted">(需{{ lesson.requireCredit }}学分)</small>
    {% endif %}

		{% if lesson.type != 'testpaper' %}
			{% set mediaTypeName = lesson.type == 'video' ? '视频' : (lesson.type == 'audio' ? '音频' : '文件') %}
			{% if mediaStatus == 'waiting' %}
			  <span class="text-warning">(正在等待{{ mediaTypeName }}格式转换)</span>
			{% elseif mediaStatus == 'doing' %}
			  <span class="text-info">(正在转换{{ mediaTypeName }}格式)</span>
			{% elseif mediaStatus == 'error' %}
			  <span class="text-danger">({{ mediaTypeName }}格式转换失败)</span>
			{% endif %}
		{% endif  %}

		{% if lesson.status == 'unpublished' %}
		  <span class="text-warning">(未发布)</span>
		{% endif %}

	</div>

	<div class="item-actions prs">
	  {% if lesson.type != 'testpaper' %}
		<button class="btn btn-link" title="添加资料" data-toggle="modal"  data-target="#modal" data-url="{{ path('course_manage_material', {courseId:course.id, lessonId:lesson.id}) }}"><span class="glyphicon glyphicon-paperclip"></span>
		</button>
	  {% endif %}
	  {% if lesson.type == 'testpaper' %}
			<a class="btn btn-link" title="预览" href="{{ path('course_manage_preview_test', {testId:lesson.mediaId}) }}" target="_blank"><span class="glyphicon glyphicon-eye-open"></span></a>
	  {% else %}
			<a class="btn btn-link" title="预览" href="{{ path('course_learn', {id:course.id, preview:1}) }}#lesson/{{ lesson.id }}" target="_blank"><span class="glyphicon glyphicon-eye-open"></span></a>
	  {% endif %}


  	{% if lesson.status == 'unpublished' %}
	  	<button class="btn btn-link publish-lesson-btn" title="发布" data-url="{{ path('course_manage_lesson_publish', {courseId:course.id, lessonId:lesson.id}) }}"><span class="glyphicon glyphicon-ok-circle"></span></button>
	  {% else %}
	  	<button class="btn btn-link unpublish-lesson-btn" title="取消发布" data-url="{{ path('course_manage_lesson_unpublish', {courseId:course.id, lessonId:lesson.id}) }}"><span class="glyphicon glyphicon-remove-circle"></span></button>
	  {% endif %}

		<button class="btn btn-link" title="编辑" data-toggle="modal" data-target="#modal" data-backdrop="static" data-keyboard="false"
		  {% if lesson.type == 'testpaper' %}
			  data-url="{{ path('course_manage_lesson_edit_testpaper', {courseId:course.id, lessonId:lesson.id}) }}"
			{% elseif lesson.type == 'live' %}
			  data-url="{{ path('live_course_manage_lesson_edit', {courseId:course.id, lessonId:lesson.id}) }}"
			{% else %}
			  data-url="{{ path('course_manage_lesson_edit', {courseId:course.id, lessonId:lesson.id}) }}"
			{% endif %}
		  ><i class="glyphicon glyphicon-edit"></i></button>

	  <button class="btn btn-link delete-lesson-btn" title="删除" data-url="{{ path('course_manage_lesson_delete', {courseId:course.id, lessonId:lesson.id}) }}"><span class="glyphicon glyphicon-trash"></span></button>

	</div>
</li>